<template>
	<view class="flPop">
		<template >

			<image src="https://static20250730.oss-cn-hangzhou.aliyuncs.com/wechatminiv2/popBg.png" class="popBg"
				mode="widthFix"></image>
			<view :class="item.type?'scroll-view-item scroll-view-item-action':'scroll-view-item'"
				v-for="(item,index) in listdata" :key="index" v-if="index==0">
				<image v-if="" :src="item.type?'/static/my/xfbg4_open.png':'/static/my/xfbg4.png'" class="xfbg"
					mode="widthFix">
				</image>
				<!-- <scroll-view scroll-y="true" class="scroll-Y" > -->

				<scroll-view scroll-y="true" class="forDetails">
					<view class="details" v-for="(item2,index2) in Data2" :key="index2">
						<view class="txt">
							{{item2.label}}
						</view>
						<uni-icons class="circleIcon" :type="item2.isactive?'checkbox-filled':'circle'"
							:color="item2.isactive?'#3CC599':'#979797'" size="20"></uni-icons>
					</view>
				</scroll-view>
				<!-- </scroll-view> -->
				<view class="infoWrap">
					<view class="leftWrap">
						<view class="lookType" @click.stop="openFn(item)">
							{{item.type?'收起条件':'查看条件'}}
						</view>
						<image src="https://cdn.pixabay.com/photo/2020/05/19/13/32/cartoon-5190837_1280.jpg" class="img"
							mode="aspectFill"></image>
					</view>
					<view class="rightWrap">
						<view class="text">
							<view class="txt">
								活动类型：转发福利{{index}}
							</view>
							<view class="txt">
								活动店铺：倒计时扭蛋馆
							</view>
							<view class="txt">
								活动机台：倒计时扭蛋馆男头50期期期期
							</view>
							<view class="txt">
								活动时效：01-23至02-23
							</view>
						</view>
						<view class="bnt" @click="participateForward">
							参与转浮
						</view>
					</view>
				</view>
			</view>
		</template>
		<view class="lookMore">

			<view class="txt">
				{{item.type?'查看已参与':'查看未参与'}}
			</view>
			<view>
				<uni-icons type="right" color="#333333" size="20"></uni-icons>
				<uni-icons class="rightIcon" type="right" color="#333333" size="20"></uni-icons>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "claimBenefitsPop",
		props: {
			machineId: {
				type: String,
				default: () => {
					return ''
				}
			},
		},
		data() {
			return {
				listdata: [{
					type: false,
				}, {
					type: true,
				}, {
					type: true,
				}, {
					type: true,
				}, ],
				Data2: [],
			};
		},
		methods: {
			openFn(item) {
				item.type = !item.type
				this.forwardSettingFn()
			},
			// 获取分享设置
			forwardSettingFn() {
				this.$http(`/v1/machines/${this.machineId}/forward-setting`).then(res => {
					console.log(res, "获取分享设置");
					if (res.code == 0) {
						this.Data2 = res.data;
					} else {
						this.$showToast(res.msg)
					}
				})
			},
			participateForward() {

				this.$http('/v1/machines/participate-forward', {
					"machine_id": Number(this.machineId),
				}, 'POST').then(res => {
					if (res.code == 0) {} else {}
					this.$showToast(res.msg)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.flPop {
		position: relative;
		// background: url('/static/my/popBg.png') no-repeat;
		// background-size: cover;
		// @include setwh(100vw,62vh);
		// @include setwh(750upx, 1000upx);
		// background-color: red;

		.popBg {
			@include setwh(720upx, 0);
			position: absolute;
			left: 0;
			top: 187upx; //158upx;
			z-index: -1;
		}

		.scroll-view-item {
			// display: block!important;
			padding: 0 40upx 0 46upx;
			position: absolute;
			top: 550upx;
			// background-color: #39289E;
			// padding: 0;

			.xfbg {
				// position: absolute;
				width: 696upx;
				height: 416upx;
				top: 0;
				left: 0;
				right: 0;
				transition: height 0.3s ease-out;
			}

			.forDetails {
				// background-color: #39289E;
				position: absolute;
				z-index: 5;
				left: 136rpx;
				top: 68px;
				transform: rotate(4deg);
				@include setwh(490upx, 130upx);
				opacity: 0;
				transition: opacity 0.2s ease-out;

				.details {
					@include flexLayout(center, space-between);

					.txt {
						font-family: SourceHanSansSC, SourceHanSansSC;
						font-weight: 500;
						font-size: 24rpx;
						color: #848484;
						line-height: 32rpx;
						width: calc(100% - 25px);
					}

					.circleIcon {}
				}
			}

			.infoWrap {
				position: absolute;
				width: 100%;
				height: 416upx;
				z-index: 1;
				bottom: 0;
				left: 0;
				right: 0;

				// background-color: #FF7474;
				.leftWrap {
					position: absolute;
					top: 0;

					.lookType {
						background: url('/static/my/openTypeBg.png') no-repeat;
						background-size: cover;
						@include setwh(128upx, 128upx);
						font-family: kkt;
						font-weight: normal;
						font-size: 18rpx;
						color: #2E2E2E;
						line-height: 128upx;
						text-align: center;
						position: relative;
						left: 70rpx;
						top: 10rpx;
						z-index: 1;
					}

					.img {
						@include setwh(186rpx, 186rpx);
						position: absolute;
						transform: rotate(-9deg);
						left: 146rpx;
						top: 76rpx;
					}
				}

				.rightWrap {
					position: absolute;
					right: 70rpx;
					bottom: 70rpx;
					transform: rotate(9deg);
					width: 310upx;
					padding-left: 34upx;

					// background-color: #2Ea;
					.text {
						font-family: kkt;
						font-weight: normal;
						position: relative;
						top: 30rpx;

						.txt {
							font-size: 18rpx;
							color: #2E2E2E;
							padding-bottom: 26upx;
						}
					}

					.bnt {
						position: relative;
						left: 24upx;
						bottom: -16upx;
						text-align: center;
						line-height: 68upx;
						font-family: AlimamaFangYuanTiVF, AlimamaFangYuanTiVF;
						font-weight: 500;
						font-size: 24rpx;
						color: #FFFFFF;
						// line-height: 28rpx;
						// width: 164rpx;
						// height: 68rpx;
						// background: #FFBBBB;
						// border-radius: 23rpx;
					}
				}
			}
		}

		.scroll-view-item-action {
			top: 400upx;

			.xfbg {
				height: 676upx;
			}

			.forDetails {
				opacity: 1;
			}

			.infoWrap {
				.leftWrap {

					.lookType {
						top: 2upx;
					}

					.img {
						top: 68rpx;
					}
				}
			}

			.infoWrap {

				.rightWrap {
					.bnt {
						bottom: -14upx;
					}
				}
			}
		}

		.lookMore {
			// display: block !important;
			// width: 400upx;
			// height: 100upx;
			// z-index: 99;
			position: absolute;
			top: 1020upx;
			// bottom: 0;
			// left: 0;
			left: 28upx;
			@include flexLayout(center, center);
			z-index: 5;

			.txt {
			white-space: nowrap;
				font-family: kkt;
				font-weight: normal;
				font-size: 32rpx;
				color: #39289E;
				line-height: 46rpx;
			}

			.rightIcon {
				margin-left: -20upx;
			}
		}
	}
</style>